package finalfrontier;

/**Classe pour l'effet du beam sur la carte
 * @author Nicolas Roy Boourdages
 */

public class Effect
{
  
  private int x;
  private int y;
  private float[] rgba;
  private int lifetime = 100;
  
  public Effect()
  {
    super();
  }

  public Effect(int x, int y, float[] f, int lifetime)
  {
    super();
    this.x = x;
    this.y = y;
    this.rgba = f;
    this.lifetime = lifetime;
  }

  public void setX(int x)
  {
    this.x = x;
  }

  public int getX()
  {
    return x;
  }

  public void setY(int y)
  {
    this.y = y;
  }

  public int getY()
  {
    return y;
  }
  
  public boolean isPositive()
  {
    if (this.x >= 0 && this.y >= 0)
    {
      return true;
    }
    else
    {
      return false;
    }
  }

    public void setRgba(float[] rgba) {
        this.rgba = rgba;
    }

    public float[] getRgba() {
        return rgba;
    }
    
    public float getAlpha(){
        return rgba[3];
    }
    
    public void setAlpha(float f){
        this.rgba[3] = f;
    }
    
    public boolean getEnd(){
        if(lifetime <= 0){
            return true;
        }
        else{
            return false;
        }
    }

    public int getLifetime() {
        return lifetime;
    }
    
    public void lowerLifetime(){
        this.lifetime -= 1;
    }
}
